<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>二手交易网</title>
    <link rel="stylesheet" href="css/myCss.css">
    <link rel="icon" href="img/school.jpg">
    <style>
        .tradeInf {
            margin-top: 20px;
            margin-left: 100px;
            width: 790px;
            font-size: 12px;
            text-align: center;
            font-family: Arial;
        }
        .tradeInf > table {
            overflow: hidden;
            width: 100%;
        }

        .tradeInf td {
            padding: 8px;
        }
        .Inf2 {
            /*display: inline-block;*/
            width: 300px;
        }
        .InfTitle {
            border: 1px solid #f40;
            font-size: 14px;
            color: #666;
        }
        .InfData {
            border: 1px solid #f40;
            border-top: 0;
        }
        .Inf1 {
            width: 68px;
        }
        .Inf3 {
            width: 70px;
        }
        .pageChange {
            margin-top:20px ;
        }
    </style>
</head>
<body>
    <div class="nav">
        <a href="index">二手交易网</a>
        <c:if test="${empty sessionScope.user }">
            <a href="login.jsp">登陆</a>
            <a href="register.jsp">注册</a>
        </c:if>
    </div>

    <div class="memu">
        <a href="index"><div class="memuNormal">所有宝贝</div></a><a href="Upload.jsp"><div class="memuNormal">上架商品</div></a><a href="goodsTradeInf"><div class="memuAll">交易信息</div></a>
    </div>

    <div class="tradeInf">
        <table cellpadding="0" cellspacing="0" class="InfTitle">
            <tbody>
            <tr>
                <td class="Inf1">交易序列</td>
                <td class="Inf2">商品名称</td>
                <td class="Inf3">商品价值</td>
                <td class="Inf4">出售者</td>
                <td class="Inf5">顾客</td>
                <td class="Inf6">购买日期</td>
            </tr>
            </tbody>
        </table>

        <table cellpadding="0" cellspacing="0" class="InfData">
            <tbody>
            <c:forEach items="${requestScope.pageBean.list}" var="goodsInf">
                <tr>
                    <td class="Inf1">${goodsInf.infId}</td>
                    <td class="Inf2">${goodsInf.goodsName}</td>
                    <td class="Inf3 price">${goodsInf.goodsValue}</td>
                    <td class="Inf4">${goodsInf.sellerName}</td>
                    <td class="Inf5">${goodsInf.customerName}</td>
                    <td class="Inf6">${goodsInf.date}&nbsp;${goodsInf.time}</td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>

    <%--导航--%>
    <div class="pageChange">
        <a href='${pageContext.request.contextPath}/goodsTradeInf?page=1' class="BeginEndOr">首页</a>

        <c:if test="${requestScope.pageBean.page!= 1}">
            <a href='${pageContext.request.contextPath}/goodsTradeInf?page=${requestScope.pageBean.page-1}' class="UpOrDown">上一页</a>
        </c:if>

        <c:forEach var="i" begin="${requestScope.pageBean.start}" end="${requestScope.pageBean.end}">
            <c:if test="${i!=requestScope.pageBean.page}">
                <a href='${pageContext.request.contextPath}/goodsTradeInf?page=${i}' class="page">${i}</a>
            </c:if>
            <c:if test="${i==requestScope.pageBean.page}">
                <span class="active">${i}</span>
            </c:if>
        </c:forEach>

        <c:if test="${requestScope.pageBean.page!= requestScope.pageBean.totalPage}">
            <a href='${pageContext.request.contextPath}/goodsTradeInf?page=${requestScope.page+1}' class="UpOrDown">下一页</a>
        </c:if>

        <a href='${pageContext.request.contextPath}/goodsTradeInf?page=${requestScope.pageBean.totalPage}' class="BeginEndOr">尾页</a>
    </div>
</body>
</html>